package top.jolyoulu.modules.poimodule.excel.reader.handler.sheet;

import lombok.extern.slf4j.Slf4j;
import top.jolyoulu.modules.poimodule.excel.reader.handler.ExcelReaderHandler;

/**
 * @Author: JolyouLu
 * @Date: 2023/12/17 16:46
 * @Description 处理每一个单元格的Handler
 */
@Slf4j
public class DefSheetReaderHandler<T> extends AbsSheetReaderHandler<T> implements ExcelReaderHandler<String> {

    public DefSheetReaderHandler(Class<T> dataType) {
        super(dataType);
    }

    @Override
    protected T handlerRow(Integer row, Integer column, String value) {
        try {
            return dataType.newInstance();
        } catch (Exception e) {
            throw new RuntimeException("SaxCellHandler构建返回对象失败", e);
        }
    }
}
